package com.hzlj.position.dbsync.liaoning.common.enums;

import com.fz.common.base.exception.PubError;
import com.fz.common.base.exception.PubException;
import lombok.Getter;

/**
 * @author lifh
 * @date 2021/11/9 上午11:59
 **/
@Getter
public enum MessageSyncType {
    INSPECTION("1", "定位数据"),
    POSITION("2", "定位数据"),
    ;

    private final String type;
    private final String typeText;

    MessageSyncType(String type, String typeText) {
        this.type = type;
        this.typeText = typeText;
    }

    public static MessageSyncType of(String code) {
        for (MessageSyncType statusEnum : values()) {
            if (statusEnum.type.equalsIgnoreCase(code)) {
                return statusEnum;
            }
        }
        throw new PubException(PubError.PARAM_EMPTY_ERROR);
    }
}
